<template>
	<view class="page">
		<div class="weui-cells_form ">
			<div class="weui-cells ">
				<div class="weui-cell">
					<div class="weui-cell__hd"><label class="weui-label">组织名称</label></div>
					<div class="weui-cell__bd">
						{{orgName}}
					</div>
				</div>
				<div class="weui-cell">
					<div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
					<div class="weui-cell__bd">
						<input class="weui-input" type="text" placeholder="请输入姓名" />
					</div>
				</div>
				<div class="weui-cell ">
					<div class="weui-cell__hd">
						<label class="weui-label">手机号</label>
					</div>
					<div class="weui-cell__bd">
						<input class="weui-input" type="tel" placeholder="请输入手机号" />
					</div>
				</div>
				<div class=" weui-cells ">
					<div class="weui-cell atop">
						<div class="weui-cell__hd"><label class="weui-label">备注</label></div>
						<div class="weui-cell__bd">
							<textarea class="weui-textarea" placeholder="填写组织备注" rows="4"></textarea>
						</div>
					</div>
				</div>
				<div class="weui-cell ">
					<div class="weui-cell__hd">
						<label class="weui-label">单位</label>
					</div>
					<div class="weui-cell__bd">
						<input class="weui-input" type="tel" placeholder="请输入单位" />
					</div>
				</div>
				<div class="weui-cell ">
					<div class="weui-cell__hd">
						<label class="weui-label">职位/职务</label>
					</div>
					<div class="weui-cell__bd">
						<input class="weui-input" type="tel" placeholder="请输入职位/职务" />
					</div>
				</div>
			</div>

			<view class="uni-padding-wrap uni-common-mt">
				<view class="button-sp-area">
					<button type="primary" :disabled="disabled" @click="saveMsg">提交</button>
				</view>
			</view>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			const currentDate = this.getDate({
				format: true
			})
			return {
				title: 'picker',
				array: ['全国', '省级', '市级'],
				index: 0,
				date: currentDate,
				time: '12:01',

				orgId: "",
				orgName: ""
			}
		},
		onLoad(option) {
			this.orgId = option.orgId;
			this.orgName = option.orgName;
		},
		computed: {
			startDate() {
				return this.getDate('start');
			},
			endDate() {
				return this.getDate('end');
			}
		},
		methods: {
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.target.value)
				this.index = e.target.value
			},
			bindDateChange: function(e) {
				this.date = e.target.value
			},
			bindTimeChange: function(e) {
				this.time = e.target.value
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			}
		}
	}
</script>

<style>
	.page {
		background: #f7f7f7;
	}

	.sc-mark-rb {
		border-radius: 50%;
		bottom: 0.825em !important;
		color: #fff;
		width: 1.75rem;
		height: 1.75rem;
		line-height: 1.75rem;
		position: absolute;
		right: 3rem;
		text-align: center;
		padding: 0.1em;
		background-color: rgba(255, 255, 255, 0.5);
	}

	.sc-mark-rb.right {
		right: 0.5rem;
	}

	.sc-mark-rb a {
		color: #000;
		font-size: 1rem;
		opacity: 1;
	}

	.marginlr0 {
		margin: 0.625rem 0 !important;
	}

	.weui-cell:before {
		left: 0;
	}

	.mrImg {
		width: 80px;
		height: 80px;
	}

	.sc-icon-flex {
		display: flex;
		justify-content: center;
	}
</style>
